package com.cn.xiaonuo.tcrfinance.tcrnews.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.common.vo.CommonParam;
import com.cn.xiaonuo.tcrfinance.tcrnews.entity.PvNoticeInfo;
import com.cn.xiaonuo.tcrfinance.tcrnews.service.HpcNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
public class HpcNewsController {

    @Autowired
    HpcNewsService hpcNewsService;



    @RequestMapping(value = "/api/news/selectNoticeInfos", method = RequestMethod.POST)
    public BusinessMessage selectNoticeInfos(@RequestBody CommonParam commonParam){
       return hpcNewsService.selectNoticeInfos(commonParam);
    }

    /**
     * 和平村-公告信息修改
     */
    @RequestMapping(value = "/api/news/updateNoticeInfo", method = RequestMethod.POST)
    public BusinessMessage updateNoticeInfo(@RequestBody PvNoticeInfo pvNoticeInfo) {
        return  hpcNewsService.updateNoticeInfo(pvNoticeInfo);
    }


    @RequestMapping(value = "/api/news/deleteNoticeInfo", method = RequestMethod.POST)
    public BusinessMessage deleteNoticeInfo(@RequestBody PvNoticeInfo pvNoticeInfo) {
        return hpcNewsService.deleteNoticeInfo(pvNoticeInfo);
    }


    @RequestMapping(value = "/api/news/insertNoticeInfo", method = RequestMethod.POST)
    public BusinessMessage insertNoticeInfo(@RequestBody PvNoticeInfo pvNoticeInfo) {
        return hpcNewsService.insertNoticeInfo(pvNoticeInfo);
    }
}
